home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / misc / Hunk.lha / Hunk / Hoppers / Oberon-A_16.hop < prev    next >
Text File  |  1998-02-14  |  6KB  |  140 lines

  1. ;*************************************************************************
  2. ;** Oberon-A 1.6                                                        **
  3. ;** Contributor: L.Lucius                               Sept 23rd 1995  **
  4. ;** Modified for HOp:   Thomas Richter  (thor)          Nov  1st  1997  **
  5. ;** Function:    Modify 68000 math routines to use 68020+ instructions. **
  6. ;*************************************************************************
  7.  
  8.  
  9. ;*************************************************************************
  10. ;
  11. ; DIV
  12. ;
  13. #match
  14. #code
  15. 48E7 3C00                       ;   MOVEM.L     D2-D5,-(A7)
  16. 4A80                            ;   TST.L       D0
  17. 5BC4                            ;   SMI         D4
  18. 6A02                            ;   BPL.B       0042
  19. 4480                            ;   NEG.L       D0
  20. 4A81                            ;   TST.L       D1
  21. 5BC5                            ;   SMI         D5
  22. 6A02                            ;   BPL.B       004A
  23. 4481                            ;   NEG.L       D1
  24. 4A81                            ;   TST.L       D1
  25. 6612                            ;   BNE.B       0060
  26. 7069                            ;   MOVEQ       #69,D0
  27. 41FA 009C                       ;   LEA         009C(PC),A0
  28. 2239 0001 0000                  ;   MOVE.L      00010000,D1
  29. 4EB9 RRRR RRRR                  ;   JSR         Kernel_Halt
  30. B081                            ;   CMP.L       D1,D0
  31. 620E                            ;   BHI.B       0072
  32. 6706                            ;   BEQ.B       006C
  33. 2200                            ;   MOVE.L      D0,D1
  34. 7000                            ;   MOVEQ       #00,D0
  35. 6070                            ;   BRA.B       00DC
  36. 7001                            ;   MOVEQ       #01,D0
  37. 7200                            ;   MOVEQ       #00,D1
  38. 606A                            ;   BRA.B       00DC
  39. B2BC 0000 0001                  ;   CMP.L       #00000001,D1
  40. 6604                            ;   BNE.B       007E
  41. 7200                            ;   MOVEQ       #00,D1
  42. 605E                            ;   BRA.B       00DC
  43. B0BC 0000 FFFF                  ;   CMP.L       #0000FFFF,D0
  44. 620E                            ;   BHI.B       0094
  45. 80C1                            ;   DIVU.W      D1,D0
  46. 4840                            ;   SWAP        D0
  47. 7200                            ;   MOVEQ       #00,D1
  48. 3200                            ;   MOVE.W      D0,D1
  49. 4240                            ;   CLR.W       D0
  50. 4840                            ;   SWAP        D0
  51. 6048                            ;   BRA.B       00DC
  52. B2BC 0000 FFFF                  ;   CMP.L       #0000FFFF,D1
  53. 6220                            ;   BHI.B       00BC
  54. 2400                            ;   MOVE.L      D0,D2
  55. 4242                            ;   CLR.W       D2
  56. 4842                            ;   SWAP        D2
  57. 84C1                            ;   DIVU.W      D1,D2
  58. 7600                            ;   MOVEQ       #00,D3
  59. 3602                            ;   MOVE.W      D2,D3
  60. 4843                            ;   SWAP        D3
  61. 3400                            ;   MOVE.W      D0,D2
  62. 84C1                            ;   DIVU.W      D1,D2
  63. 2202                            ;   MOVE.L      D2,D1
  64. 4241                            ;   CLR.W       D1
  65. 4841                            ;   SWAP        D1
  66. 7000                            ;   MOVEQ       #00,D0
  67. 3002                            ;   MOVE.W      D2,D0
  68. D083                            ;   ADD.L       D3,D0
  69. 6020                            ;   BRA.B       00DC
  70. 7401                            ;   MOVEQ       #01,D2
  71. 7600                            ;   MOVEQ       #00,D3
  72. B280                            ;   CMP.L       D0,D1
  73. 6206                            ;   BHI.B       00CA
  74. D482                            ;   ADD.L       D2,D2
  75. D281                            ;   ADD.L       D1,D1
  76. 6AF6                            ;   BPL.B       00C0
  77. B280                            ;   CMP.L       D0,D1
  78. 6204                            ;   BHI.B       00D2
  79. 8682                            ;   OR.L        D2,D3
  80. 9081                            ;   SUB.L       D1,D0
  81. E289                            ;   LSR.L       #1,D1
  82. E28A                            ;   LSR.L       #1,D2
  83. 66F2                            ;   BNE.B       00CA
  84. 2200                            ;   MOVE.L      D0,D1
  85. 2003                            ;   MOVE.L      D3,D0
  86. BA04                            ;   CMP.B       D4,D5
  87. 6702                            ;   BEQ.B       00E2
  88. 4480                            ;   NEG.L       D0
  89. 4A04                            ;   TST.B       D4
  90. 6702                            ;   BEQ.B       00E8
  91. 4481                            ;   NEG.L       D1
  92. 4CDF 003C                       ;   MOVEM.L     (A7)+,D2-D5
  93. 4E75                            ;   RTS
  94. ;
  95. ;
  96. #replace
  97. 4C41 0801                       ;   DIVSL.L     D1,D1:D0
  98. 4E75                            ;   RTS
  99. #end
  100.  
  101.  
  102. ;*************************************************************************
  103. ;
  104. ; MUL
  105. ;
  106. #match
  107. #code
  108. 48E7 3800                       ;   MOVEM.L     D2-D4,-(A7)
  109. 4A80                            ;   TST.L       D0
  110. 5BC4                            ;   SMI         D4
  111. 6A02                            ;   BPL.B       000C
  112. 4480                            ;   NEG.L       D0
  113. 4A81                            ;   TST.L       D1
  114. 6A04                            ;   BPL.B       0014
  115. 4604                            ;   NOT.B       D4
  116. 4481                            ;   NEG.L       D1
  117. 3401                            ;   MOVE.W      D1,D2
  118. C4C0                            ;   MULU.W      D0,D2
  119. 2601                            ;   MOVE.L      D1,D3
  120. 4843                            ;   SWAP        D3
  121. C6C0                            ;   MULU.W      D0,D3
  122. 4840                            ;   SWAP        D0
  123. C0C1                            ;   MULU.W      D1,D0
  124. D083                            ;   ADD.L       D3,D0
  125. 4840                            ;   SWAP        D0
  126. 4240                            ;   CLR.W       D0
  127. D082                            ;   ADD.L       D2,D0
  128. 4A04                            ;   TST.B       D4
  129. 6702                            ;   BEQ.B       0030
  130. 4480                            ;   NEG.L       D0
  131. 4CDF 001C                       ;   MOVEM.L     (A7)+,D2-D4
  132. 4E75                            ;   RTS
  133. ;
  134. ;
  135. #replace
  136. 4C01 0800                       ;   MULS.L      D1,D0
  137. 4E75                            ;   RTS
  138. #end
  139.  
  140.